package kr.co.doriclassic.chapter24.student.vo;

import java.io.Serializable;

public class Department implements Serializable, Comparable<Department>{
	
	private static final long serialVersionUID = 4862291987601887817L;
	private int depNo;
	private String depName;
	private int floor;
	
	public Department(int depNo, String depName) {
		this.depNo = depNo;
		this.depName = depName;
	}

	public Department(int depNo, String depName, int floor) {
		this.depNo = depNo;
		this.depName = depName;
		this.floor = floor;
	}

	@Override
	public int compareTo(Department o) {
		// TODO Auto-generated method stub
		return depNo-o.depNo;
	}

	@Override
	public boolean equals(Object obj) {
		boolean result = false;
		if(obj instanceof Department){
			Department temp = (Department)obj;
			result = (depNo==temp.depNo&&depName.equals(temp.depName));
		}
		return result;
	}

	@Override
	public String toString() {
		return String.format("%3s\t%5s\t%3s",
				depNo, depName, floor);
	}

	public int getDepNo() {
		return depNo;
	}

	public void setDepNo(int depNo) {
		this.depNo = depNo;
	}

	public String getDepName() {
		return depName;
	}

	public void setDepName(String depName) {
		this.depName = depName;
	}

	public int getFloor() {
		return floor;
	}

	public void setFloor(int floor) {
		this.floor = floor;
	}	
}
